package com.jisf.driver.response;

import com.jisf.driver.utils.ParameterUtil;

/**
 * @Classname ResultCode
 * @Description TODO
 * @Date 2022/3/22 22:28
 * @Created by jisf：【429627912@qq.com】
 */
public enum ResultCode implements IErrorCode{
    SYSTEM_FAILED(-1, "系统错误"),
    LOGIN_FAILED(-2, "登录失败"),

    USER_NOT_LOGIN(2001, "用户未登录"),
    USER_ACCOUNT_EXPIRED(2002, "账号已过期"),
    USER_CREDENTIALS_ERROR(2003, "密码错误"),
    USER_CREDENTIALS_EXPIRED(2004, "密码过期"),
    USER_ACCOUNT_DISABLE(2005, "账号不可用"),
    USER_ACCOUNT_LOCKED(2006, "账号被锁定"),
    USER_ACCOUNT_NOT_EXIST(2007, "账号不存在"),
    USER_ACCOUNT_ALREADY_EXIST(2008, "账号已存在"),
    USER_ACCOUNT_USE_BY_OTHERS(2009, "登录超时或在另一台机器登录，您被迫下线"),
    USER_SESSION_INVALID(2010, "登录已经超时"),

    NO_PERMISSION(4001, "没有权限"),

    DataBaseException(5006, "MySQL异常"),

    USER_ADD_SUCCESS(GlobalConstant.SUCCESS, "用户添加成功"),
    USER_ADD_FAILED(5001, "用户添加失败"),
    USER_DEL_FLAG_SUCCESS(GlobalConstant.SUCCESS, "用户删除成功"),
    USER_DEL_FLAG_FAILED(5002, "用户删除失败"),
    USER_STATUS_UPDATE_SUCCESS(GlobalConstant.SUCCESS, "用户状态更新成功"),
    USER_STATUS_UPDATE_FAILED(5003, "用户状态更新失败"),
    USER_PASSWORD_UPDATE_SUCCESS(GlobalConstant.SUCCESS, "用户密码修改成功"),
    USER_PASSWORD_UPDATE_FAILED(5004, "用户密码修改失败"),
    USER_ROLE_DELETE_SUCCESS(GlobalConstant.SUCCESS, "用户角色删除成功"),
    USER_ROLE_DELETE_FAILED(5005, "用户角色删除失败"),
    USER_ROLE_ALLOT_SUCCESS(GlobalConstant.SUCCESS, "用户分配角色成功"),
    USER_ROLE_ALLOT_FAILED(5006, "用户分配角色失败"),

    ROLE_ADD_SUCCESS(GlobalConstant.SUCCESS, "角色添加成功"),
    ROLE_ADD_FAILED(5011, "角色添加失败"),
    ROLE_DEL_FLAG_SUCCESS(GlobalConstant.SUCCESS, "角色删除成功"),
    ROLE_DEL_FLAG_FAILED(5012, "角色删除失败"),
    ROLE_STATUS_UPDATE_SUCCESS(GlobalConstant.SUCCESS, "角色状态更新成功"),
    ROLE_STATUS_UPDATE_FAILED(5013, "角色状态更新失败"),
    ROLE_UPDATE_SUCCESS(GlobalConstant.SUCCESS, "角色修改成功"),
    ROLE_UPDATE_FAILED(5014, "角色修改失败"),
    ROLE_MENU_DELETE_SUCCESS(GlobalConstant.SUCCESS, "角色权限删除成功"),
    ROLE_MENU_DELETE_FAILED(5015, "角色权限删除失败"),
    ROLE_MENU_ALLOT_SUCCESS(GlobalConstant.SUCCESS, "角色分配权限成功"),
    ROLE_MENU_ALLOT_FAILED(5016, "角色分配权限失败"),

    MENU_STATUS_UPDATE_SUCCESS(GlobalConstant.SUCCESS, "权限状态更新成功"),
    MENU_STATUS_UPDATE_FAILED(5023, "权限状态更新失败"),
    MENU_VISIBLE_UPDATE_SUCCESS(GlobalConstant.SUCCESS, "权限菜单栏更新成功"),
    MENU_VISIBLE_UPDATE_FAILED(5024, "权限菜单栏更新失败"),

    COURSE_APPOINT_SUCCESS(GlobalConstant.SUCCESS, "课程预约成功"),
    COURSE_APPOINT_FAILED(5031, "课程预约失败"),
    COURSE_APPOINT_NUMBER_FAILED(5031, String.format("课程预约失败，最多只能预约%d个课程", ParameterUtil.appointCourseNumber)),
    COURSE_APPOINT_SUBJECT_TIME_FAILED(5031, "课程预约失败，剩余课时不足"),
    COURSE_CANCEL_SUCCESS(GlobalConstant.SUCCESS, "课程取消成功"),
    COURSE_CANCEL_DATE_FAILED(5032, String.format("课程取消失败，课程开始前%d小时内不能取消课程", ParameterUtil.CourseChangeTime)),
    COURSE_CANCEL_FAILED(5032, "课程取消失败"),
    COURSE_STALE_DATED(5033, "课程已过期"),
    COURSE_CLOSE_APPOINT_SUCCESS(GlobalConstant.SUCCESS, "关闭预约成功"),
    COURSE_CLOSE_APPOINT_FAILED(5034, "关闭预约失败"),
    COURSE_OPEN_APPOINT_SUCCESS(GlobalConstant.SUCCESS, "开启预约成功"),
    COURSE_OPEN_APPOINT_FAILED(5035, "开启预约失败"),

    EXAMINE_ADD_SUCCESS(GlobalConstant.SUCCESS, "新增考试成功"),
    EXAMINE_ADD_FAILED(5041, "新增考试失败"),
    EXAMINE_APPOINT_SUCCESS(GlobalConstant.SUCCESS, "考试报名成功"),
    EXAMINE_APPOINT_FAILED(5042, "考试报名失败"),
    EXAMINE_APPOINT_FULL_FAILED(5042, "考试报名人数已满"),
    EXAMINE_HAVE_APPOINT_FAILED(5042, "考试报名失败，已经报名该考试"),
    EXAMINE_HAVE_APPOINT_OTHER_FAILED(5042, "考试报名失败，已经报名该考试科目的其他考试"),
    EXAMINE_APPOINT_SUBJECT_TIME_FAILED(5042, "考试报名失败，剩余考试次数不足"),
    EXAMINE_CANCEL_APPOINT_SUCCESS(GlobalConstant.SUCCESS, "取消报名成功"),
    EXAMINE_CANCEL_APPOINT_FAILED(5043, "取消报名失败"),
    EXAMINE_HAVE_CANCEL_APPOINT_FAILED(5043, "取消报名失败，未报名该考试"),
    EXAMINE_FINISH_APPOINT_SUCCESS(GlobalConstant.SUCCESS, "考试报名结束成功"),
    EXAMINE_FINISH_APPOINT_FAILED(5044, "考试报名结束失败"),
    EXAMINE_SET_COACH_SUCCESS(GlobalConstant.SUCCESS, "考试分配教练成功"),
    EXAMINE_SET_COACH_FAILED(5045, "考试分配教练失败"),
    EXAMINE_SET_GRADE_SUCCESS(GlobalConstant.SUCCESS, "考生评分成功"),
    EXAMINE_SET_GRADE_FAILED(5046, "考生评分失败"),
    EXAMINE_SET_REMARK_SUCCESS(GlobalConstant.SUCCESS, "设置考生成绩说明成功"),
    EXAMINE_SET_REMARK_FAILED(5047, "设置考生成绩说明失败"),

    APPLY_ADD_SUCCESS(GlobalConstant.SUCCESS, "套餐添加成功"),
    APPLY_ADD_FAILED(5051, "套餐添加失败"),
    APPLY_DELETE_SUCCESS(GlobalConstant.SUCCESS, "套餐删除成功"),
    APPLY_DELETE_FAILED(5052, "套餐删除失败"),
    APPLY_APPLY_SUCCESS(GlobalConstant.SUCCESS, "套餐申请成功"),
    APPLY_APPLY_FAILED(5053, "套餐申请失败"),
    APPLY_PASS_APPLY_SUCCESS(GlobalConstant.SUCCESS, "通过申请成功"),
    APPLY_PASS_APPLY_FAILED(5054, "通过申请失败"),
    APPLY_NO_PASS_APPLY_SUCCESS(GlobalConstant.SUCCESS, "拒绝申请成功"),
    APPLY_NO_PASS_APPLY_FAILED(5055, "拒绝申请失败"),

    MESSAGE_COMPLETE_SUCCESS(GlobalConstant.SUCCESS, "完善信息成功"),
    MESSAGE_COMPLETE_FAILED(5061, "完善信息失败"),
    MESSAGE_UPDATE_STUDENT_SUCCESS(GlobalConstant.SUCCESS, "修改学员信息成功"),
    MESSAGE_UPDATE_STUDENT_FAILED(5062, "修改学员信息失败"),
    MESSAGE_UPDATE_COACH_SUCCESS(GlobalConstant.SUCCESS, "修改教练信息成功"),
    MESSAGE_UPDATE_COACH_FAILED(5062, "修改教练信息失败"),

    CHAT_SEND_MESSAGE_SUCCESS(GlobalConstant.SUCCESS, "聊天消息发送成功"),
    CHAT_SEND_MESSAGE_FAILED(5071, "聊天消息发送失败"),
    ;


    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    private Integer code;
    private String message;

    @Override
    public Integer getCode(){
        return code;
    }

    @Override
    public String getMessage(){
        return message;
    }
}
